let examDetails;
let studentDetails;

// 更新考试下拉列表
function updateExamList(newExamDetails) {
    examDetails = newExamDetails;
    populateExamSelect();
    if (Object.keys(examDetails).length > 0) {
        examCode = Object.keys(examDetails)[0];
        renderExamTable();
        renderExamLevels();
        renderExamBarChart();
    }
}

// 更新学生下拉列表
function updateStudentList(newStudentDetails) {
    studentDetails = newStudentDetails;
    populateStudentSelect();
    if (Object.keys(studentDetails).length > 0) {
        studentCode = Object.keys(studentDetails)[0];
        renderGradeTable();
        renderChart();
    }
}